package cn.com.wantools.web.api.wantools;

import cn.com.wantools.commons.Rets;
import cn.com.wantools.model.unitconvert.UcConvertType;
import cn.com.wantools.model.unitconvert.UcGroupDto;
import cn.com.wantools.service.UcIndexService;
import cn.com.wantools.web.base.ApiControllerBase;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Ret;
import io.jboot.apidoc.ContentType;
import io.jboot.apidoc.annotation.Api;
import io.jboot.apidoc.annotation.ApiOper;
import io.jboot.web.controller.annotation.RequestMapping;

import java.util.List;

@RequestMapping("/api/indexPageApi")
@Api("首页布局API ")
public class IndexPageApiController extends ApiControllerBase {
    @Inject
    private UcIndexService ucIndexService;

    @ApiOper(value = "首页布局", contentType = ContentType.JSON)
    public Ret loadIndexPageGroupList() {
        try {
            List<UcGroupDto> ucGroupDtoList = ucIndexService.loadIndexConfigService();
            return Ret.create("ucGroupDtoList", ucGroupDtoList);
        } catch (Exception e) {
            return Rets.FAIL;
        }
    }


}
